﻿Imports System.Data
Imports System.Data.OleDb

Public Class rss
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Dim oleDbConn1 As New OleDb.OleDbConnection(ConfigurationManager.ConnectionStrings("diycakeConnectionString").ConnectionString)
        Dim SqlString1 As String = "SELECT TOP 10 ID, cakeTitle, cakeDesc, cakeDateAdded, cakeUser FROM cake ORDER BY ID DESC"
        Dim cmd1 As OleDbCommand = New OleDbCommand(SqlString1, oleDbConn1)
        cmd1.CommandType = CommandType.Text
        oleDbConn1.Open()
        Dim dataReader = cmd1.ExecuteReader()
        RepeaterRSS.DataSource = dataReader
        RepeaterRSS.DataBind()

    End Sub
    Protected Function RemoveIllegalCharacters(ByVal input As Object) As String
        ' cast the input to a string
        Dim data As String = input.ToString()
        ' replace illegal characters in XML documents with their entity references
        data = data.Replace("&", "&amp;")
        data = data.Replace("""", "&quot;")
        data = data.Replace("'", "&apos;")
        data = data.Replace("<", "&lt;")
        data = data.Replace(">", "&gt;")
        Return data
    End Function
End Class